<?php

/**
 * This is the model class for table "telefonos_has_usuarios".
 *
 * The followings are the available columns in table 'telefonos_has_usuarios':
 * @property string $Telefonos_id_telefonos
 * @property string $Usuarios_id_usuarios
 */
class TelefonosHasUsuarios extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return TelefonosHasUsuarios the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'telefonos_has_usuarios';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('Telefonos_id_telefonos, Usuarios_id_usuarios', 'required'),
			array('Telefonos_id_telefonos, Usuarios_id_usuarios', 'length', 'max'=>10),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('Telefonos_id_telefonos, Usuarios_id_usuarios', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
//		'telefonos'=>array(self::HAS_MANY, 'Telefonos', 'id_telefonos'),
	//	'usuarios'=>array(self::HAS_MANY, 'Usuarios', 'id_usuarios'),

		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'Telefonos_id_telefonos' => 'Telefonos Id Telefonos',
			'Usuarios_id_usuarios' => 'Usuarios Id Usuarios',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('Telefonos_id_telefonos',$this->Telefonos_id_telefonos,true);
		$criteria->compare('Usuarios_id_usuarios',$this->Usuarios_id_usuarios,true);

		return new CActiveDataProvider(get_class($this), array(
			'criteria'=>$criteria,
		));
	}
}